package com.example.day16;

import java.util.ArrayList;
import java.util.Collections;

/**
 * @author Lenovo
 */
public class PokerDemo {
    public static void main(String[] args) {
        ArrayList<String> array = new ArrayList<String>();
        String [] colors = {"红桃","黑桃","梅花","方片"};
        String [] numbers = {"A","2","3","4","5","6","7","8","9","10","J","Q","K"};
        for (String color : colors) {
            for (String number : numbers) {
                array.add(color+number);
            }
        }
        array.add("小王");
        array.add("大王");
        Collections.shuffle(array);
        ArrayList<String> lqxArray = new ArrayList<String>();
        ArrayList<String> lyArray = new ArrayList<String>();
        ArrayList<String> fqyArray = new ArrayList<String>();
        ArrayList<String> dpArray = new ArrayList<String>();
        for (int i = 0; i < array.size(); i++) {
            if (i>=array.size()-3){
                dpArray.add(array.get(i));
            }else if (i>=array.size()-2){
                fqyArray.add(array.get(i));
            }else if (i>=array.size()-1){
                lyArray.add(array.get(i));
            }else {
                lqxArray.add(array.get(i));
            }
        }
        lookPoker("刘强雄",lqxArray);
        lookPoker("李元霸",lyArray);
        lookPoker("风清扬", fqyArray);
        lookPoker("底牌", dpArray);
    }
    public static void lookPoker(String name,ArrayList<String> array){
        System.out.print(name+"的牌是：");
        for (String s : array) {
            System.out.print(s+" ");
        }
        System.out.println();
    }
}
